import com.huang.dao.UserDao;
import com.huang.dao.UserDaoImpl;
import com.huang.service.UserService;
import com.huang.service.UserServiceImpl;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Mytest {
    public static void main(String[] args) {
        UserService userService=new UserServiceImpl();
        userService.setUserDao(new UserDaoImpl());
        userService.getUser();
    }
    @Test
    public void test(){
        ApplicationContext context = new ClassPathXmlApplicationContext("beans.xml");
       UserService userService = (UserServiceImpl) context.getBean("userserviceImpl");
        userService.getUser();
    }
}
